namespace Kopernikus.Parsing.Lexing
{
    public class LexerMatch : IConvertToSymbol
    {
        private readonly int m_col;
        private readonly int m_line;
        private readonly int m_position;
        private readonly Symbol m_symbol;
        private readonly string m_value;

        public LexerMatch(Symbol symbol, string value, int position, int line, int col)
        {
            m_symbol = symbol;
            m_value = value;
            m_col = col;
            m_line = line;
            m_position = position;
        }

        public string Value
        {
            get { return m_value; }
        }

        public int Position
        {
            get { return m_position; }
        }

        public int Line
        {
            get { return m_line; }
        }

        public int Col
        {
            get { return m_col; }
        }

        #region IConvertToSymbol Members

        public Symbol Symbol
        {
            get { return m_symbol; }
        }

        #endregion

        public override string ToString()
        {
            return string.Format("[\"{0}\",{1} at ({2},{3})]", Value, Symbol, Line, Col);
        }
    }
}